package com.ttxs.uaa.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ttxs.uaa.vo.UserVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 用户信息表 Mapper 接口
 * </p>
 *
 * @author 天天向上
 * @since 2021-07-26
 */
public interface SysUserVoMapper extends BaseMapper<UserVO> {
    String querySql = "SELECT u.*, d.dept_name FROM sys_user u INNER JOIN sys_dept d ON u.dept_id = d.dept_id";
    String queryWrapperSql = "SELECT * FROM (" + querySql + ") AS q ${ew.customSqlSegment}";

    @Select(queryWrapperSql)
    Page<UserVO> selectPageVo(Page<UserVO> page, @Param(Constants.WRAPPER) Wrapper<UserVO> queryWrapper);

}
